#pragma once

#include "../umlmodel_global.h"

#include <memory>
#include <vector>

#include "AcceptEventAction.h"

using std::make_shared;
using std::shared_ptr;
using std::vector;

namespace uml {
class OutputPin;

/// <summary>
/// AcceptCallAction
/// An AcceptCallAction is an AcceptEventAction that handles the receipt of a
/// synchronous call request. In addition to the values from the Operation input
/// parameters, the Action produces an output that is needed later to supply the
/// information to the ReplyAction necessary to return control to the caller. An
/// AcceptCallAction is for synchronous calls. If it is used to handle an
/// asynchronous call, execution of the subsequent ReplyAction will complete
/// immediately with no effect.
/// </summary>
class UMLMODEL_EXPORT AcceptCallAction : public AcceptEventAction {

public: // Constructors and destructors
    explicit AcceptCallAction(const QString& umlType="uml::AcceptCallAction");

public: // JsonSerializable override
    void fromJson(const QJsonObject& json, QStringList& errorList) override;
    void toJson(QJsonObject& json) override;

public: // Properties
    /// <summary>
    /// returnInformation getter
    /// An OutputPin where a value is placed containing sufficient information to
    /// perform a subsequent ReplyAction and return control to the caller. The contents
    /// of this value are opaque. It can be passed and copied but it cannot be
    /// manipulated by the model.
    /// </summary>
    shared_ptr<OutputPin> returnInformation() const;

    /// <summary>
    /// returnInformation setter
    /// An OutputPin where a value is placed containing sufficient information to
    /// perform a subsequent ReplyAction and return control to the caller. The contents
    /// of this value are opaque. It can be passed and copied but it cannot be
    /// manipulated by the model.
    /// </summary>
    void setReturnInformation(shared_ptr<OutputPin> value);

private: // Fields
    /// <summary>
    /// returnInformation
    /// An OutputPin where a value is placed containing sufficient information to
    /// perform a subsequent ReplyAction and return control to the caller. The contents
    /// of this value are opaque. It can be passed and copied but it cannot be
    /// manipulated by the model.
    /// </summary>
    shared_ptr<OutputPin> returnInformation_;

};

} // namespace uml
